#ifndef __CLOCK_H__
#define __CLOCK_H__

#include "common.h"

#define CLKTIMERID 0 //use timer0 as system clock
#if(CLKTIMERID)
	#define CLKTIMERINTID TF1_VECTOR
#else
	#define CLKTIMERINTID TF0_VECTOR
#endif

void CLK_INIT();
bool CLK_ADDCLK(uint *ctAdd);
#define CLK_ENABLE() TR(CLKTIMERID)=1;
#define CLK_DISABLE() TR(CLKTIMERID)=0;
void CLK_DELAY(uint ct);

#ifdef SDCC
void clock_timer(void) interrupt CLKTIMERINTID;
#endif

#endif//__CLOCK_H__
